package com.ruoyi.common.core.enums;

/**
 * 语言枚举类
 */
public enum LanguageEnum {

    ZH_CN("ZH-CN","ZH","简体中文","中文","Simplified Chinese"),
    EN("EN","EN","英文","English","English"),
    KO("KO","KO","韩语","한국어","Korean"),
    JA("JA","JA","日语","にほんご","Japanese"),
    TH("TH","TH","泰语","ไทย","Thai"),
    MS("MS","MS","马来语","Bahasa Melayu","Malay"),
    VI("VI","VI","越南语","Việt","Vietnamese"),
    LO("LO","LO","老挝语","ພາສາລາວ","Lao"),
    RU("RU","RU","俄语","русский","Russian"),
    AR("AR","AR","阿拉伯语","عربي/عربى‎","Arabic"),
    TL("TL","TL","他加禄语","Tagalog","Tagalog"),
    KM("KM","KM","高棉语","ជនជាតិខ្មែរ","Khmer"),
    MY("MY","MY","缅甸语","ဗမာ","Burmese"),
    ID("ID","ID","印度尼西亚语","bahasa Indonesia","Indonesian"),
    EL("EL","EL","希腊语","Ελληνικά","Greek"),
    MN("MN","MN","蒙古语","Монгол","Mongolian"),
    TE("TE","TE","德顿语","Tetun","Tetum"),
    NE("NE","NE","尼泊尔语","नेपाली","Nepali"),
    DZ("DZ","DZ","宗卡语","རྫོང་ཁ།","Dzongkha"),
    BN("BN","BN","孟加拉语","বাংলা","Bengali"),
    HI("HI","HI","印地语","हिंदी","Hindi"),
    UR("UR","UR","乌尔都语","اردو","Urdu"),
    SI("SI","SI","僧伽罗语","සිංහල","Sinhala"),
    ZH_HK("ZH-HK","ZH","繁体中文(香港)","繁體中文(香港)","Traditional Chinese(Hong Kong)"),
    ZH_TW("ZH-TW","ZH","繁体中文(台湾)","繁體中文(台灣)","Traditional Chinese(Taiwan)");

    private final String iso;
    private final String iso2;
    private final String nameCn;
    private final String nameLocal;
    private final String nameEn;

    LanguageEnum(String iso, String iso2, String nameCn, String nameLocal, String nameEn) {
        this.iso = iso;
        this.iso2 = iso2;
        this.nameCn = nameCn;
        this.nameLocal = nameLocal;
        this.nameEn = nameEn;
    }

    public String getIso() {
        return iso;
    }

    public String getIso2() {
        return iso2;
    }

    public String getNameCn() {
        return nameCn;
    }

    public String getNameLocal() {
        return nameLocal;
    }

    public String getNameEn() {
        return nameEn;
    }

    public static String getNameCnByIso(String iso) {
        for (LanguageEnum item : LanguageEnum.values()) {
            if (item.getIso().equals(iso)) {
                return item.getNameCn();
            }
        }
        return "";
    }

    public static String getIso2ByIso(String iso) {
        for (LanguageEnum item : LanguageEnum.values()) {
            if (item.getIso().equals(iso)) {
                return item.getIso2();
            }
        }
        return "";
    }

    public static String getNameEnByIso(String iso) {
        for (LanguageEnum item : LanguageEnum.values()) {
            if (item.getIso().equals(iso)) {
                return item.getNameEn();
            }
        }
        return "";
    }

    public static String getNameLocalByIso(String iso) {
        for (LanguageEnum item : LanguageEnum.values()) {
            if (item.getIso().equals(iso)) {
                return item.getNameLocal();
            }
        }
        return "";
    }
}
